/** ***********************************************
 * CodeGen
 *
 * @author  Jonnie Spratley
 * @date 3/05/2009
 * @licence MCIYC
 * @website http://jonniespratley.com/code
 * @contact jonniespratley@gmail.com
 *********************************************** */
package com.jonniespratley.codegen.events
{
	/**
	 * Cairngorm provides a singleton Cairngorm Event Dispatcher that works with the Front Controller class.
	 * Whenever you want to dispatch Cairngorm events, you use the Cairngorm Event Dispatcher.
	 *
	 * The following code shows how to broadcast a Cairngorm event using
	 * the Cairngorm Event Dispatcher:
	 *
	 * <code>
	 *	var evt:YourEvent = new YourEvent( YourEvent.NAME_OF_EVENT );
	 *		evt.dispatchEvent();
	 *</code>
	 *
	 * The dispatchEvent() method of the Cairngorm Event Dispatcher singleton takes a parameter of
	 * type flash.events.Event. This event is dispatched and the corresponding command is executed.
	 *
	 * This is how the Front Controller, Cairngorm Event Dispatcher, Command patterns, and
	 * Cairngorm Events work together with the Cairngorm Event, the Model Locator, and VO
	 * patterns to create an immersive experience for the user of an RIA.
	 *
	 */
	import com.adobe.cairngorm.control.CairngormEvent;

	import flash.events.Event;

	public final class CallClassFunctionEvent extends CairngormEvent
	{
		public static const CALL_CLASS_FUNCTION_EVENT:String = "CALL_CLASS_FUNCTION_EVENT";
		//classPath:String, classFunction:String, classArgs:Array
		public var aClassPath:String;
		public var aClassFunction:String;
		public var aClassArgs:Array;

		public function CallClassFunctionEvent( classPath:String, classFunction:String, classArgs:Array )
		{
			super( CALL_CLASS_FUNCTION_EVENT );
			this.aClassPath = classPath;
			this.aClassFunction = classFunction;
			this.aClassArgs = classArgs;
		}

		override public function clone():Event
		{
			return new CallClassFunctionEvent( aClassPath, aClassFunction, aClassArgs );

		}
	}
}